<?php 
include("conexion.php");

$sql =mysql_query("SELECT * FROM tipokar",$conn) or die(mysql_error());

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="JavaScript" type="text/javascript" src="ajax.js"></script>
<script src="jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.uniform.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="css/uniform.default.css" type="text/css" media="screen">
<script type="text/javascript" charset="utf-8">
      $(function(){
        $("input, textarea, select, button").uniform();
      });
    </script>

<title>Untitled Document</title>
<style type="text/css">
<!--
.titubuskar {
	font-family: Calibri;
	font-size: 12px;
	font-weight: bold;
	font-style: italic;
	color: #003366;
}
.titubuskar0 {font-family: Calibri; font-size: 12px; font-style: italic; font-weight: bold; color: #333333; }
.titubuskar1 {color: #333333}
.reskar2 {font-family: Calibri; font-size: 13px; font-weight: bold; font-style: italic; color: #003366; }
.reskar {font-size: 12px; font-style: italic; color: #333333; font-family: Calibri;}
-->
</style>
<script type="text/javascript">
$(document).ready(function(){ 

cargakardex(0)
});

function cargakardex2()
{
	
  //$("#_imagen").attr('name');
  
  var _nnkardex	 = $('#nnkardex').val();
  var _tipoper 	 = $('#tipoper').val();
  var _nomcontratante 	 = $('#nomcontratante').val();
	
	 if(_tipoper=='' &&  _nomcontratante!='' ){
		
		alert('debe seleccionar tipo de persona')}
		
		else if(_nnkardex=='' && _nomcontratante=='')
	{
		var limite     = 0;
		var _estado    = "1";	 
	}
	else if(_nnkardex!='' || _nomcontratante!='' ){
		var limite     = 0;
		var _estado    = "2"; 
		
		}
	
		
//alert(_estado);
	 var _data =
	 {
		nnkardex 		: _nnkardex,
		tipoper   		: _tipoper,
		nomcontratante 	: _nomcontratante,
		estado			: _estado,
		limite          : limite
	 }
	  

	$("#bkardex").load("busqueda_kardex.php",_data);

	  return false;
}

//$(document).ready(cargakardex(0));

function cargakardex(limite)
{
	var url="busqueda_kardex.php";
	$.post(url,{estado : "1",limite: limite},function (responseText){
		    $("#bkardex").html(responseText);
	  });
}
</script>
</head>

<body>
<table width="858" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="846" height="25"><span class="reskar2">Busqueda Por:</span></td>
    <td width="12" rowspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td><form name="frmbuscakardex" method="post" action="">
      <table width="837" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="79"><span class="titubuskar0">N° Kardex</span></td>
          <td width="85"><span class="titubuskar0">
            <label>
            <input name="nnkardex" type="text" id="nnkardex" size="12">
            </label>
          </span></td>
          <td width="19">&nbsp;</td>
          <td width="96"><span class="titubuskar0">Tipo Contratante</span></td>
          <td width="161"><span class="titubuskar1">
            <select name="tipoper" id="tipoper" >
              <option value = "" selected="selected">TIPO DE PERSONA</option>
              <option value="N">Natural</option>
              <option value="J">Jurídica</option>
            </select></span></td>
          <td width="397"><label>
            <input name="nomcontratante" type="text" id="nomcontratante" size="40">
          <a onclick="cargakardex2()"><img src="iconos/buscarclie.png" width="72" height="29" border="0" /></a></label></td>
        </tr>
      </table>
        </form>   </td>
  </tr>
  <tr>
    <td colspan="2">--------------------------------------------------------------------------------------------------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan="2"><div id="gennn" style="width:860px; height:690px; overflow:auto;">
      <table width="200" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><table width="1467" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333" bgcolor="#CCCCCC">
            <tr>
              <td width="63" align="center"><span class="titubuskar0">N° Kardex</span></td>
              <td width="200" align="center"><span class="titubuskar0">Tipo de Kardex</span></td>
              <td width="86" align="center"><span class="titubuskar0">Fecha de Ingreso</span></td>
              <td width="238" align="center"><span class="titubuskar0">Actos</span></td>
              <td width="257" align="center"><span class="titubuskar0">Referencia</span></td>
              <td width="90" align="center"><span class="titubuskar0">Fecha Escritura</span></td>
              <td width="96" align="center"><span class="titubuskar0">Nº Escritura</span></td>
              <td width="70" align="center"><span class="titubuskar0">Folio</span></td>
              <td width="97" align="center"><span class="titubuskar0">Fecha Conclusión</span></td>
               <td width="200" align="center"><span class="titubuskar0">Responsable Kardex
              </span></td>
              <td width="50" align="center">&nbsp;</td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td><div id="bkardex">



          </div></td>
        </tr>
      </table>
    </div></td>
  </tr>
</table>

</body>
</html>



